import Vue from 'vue'
import Vuex from 'vuex'
import * as actions from './actions'
import * as getters from './getters'
import user from './modules/user'
import { SET_LOADING, SET_SIDEMENU } from './mutation-types'

Vue.use(Vuex)

export default new Vuex.Store({
	state :{
		loading :false,
		showSideMenu : true,
		refreshTimes : 0,
		userInfo: null,
		baseURL: 'http://127.0.0.1:8081/'
	},
	mutations: {
	    [SET_LOADING](state, loading) {
	        state.loading = loading
	    },
	    [SET_SIDEMENU](state, loading) {
	        state.showSideMenu = loading
	    },

	},
    modules: {
        user
    },
    actions,
    getters,
})
